{include file='public/header.html'}

<div class="container mtn">
	{include file='user/_top_nav.html'}

	<div class="panel panel-default mtn">
		<div class="panel-heading">
			成员管理 | 待审核 {:get_member_count()} <span class="pull-right"><a href="javascript:history.back(-1);">返回</a></span>
		</div>
		<div class="panel-body">
			<button type="button" class="btn btn-success" onclick="actionConfirm('通过审核','{:url('member_state?params=status-1')}');">通过审核</button>
			<button type="button" class="btn btn-info" onclick="actionConfirm('设为待审','{:url('member_state?params=status-0')}');">设为待审</button>
			<button type="button" class="btn btn-danger" onclick="actionConfirm('删除', '{:url('member_del')}');">删除</button>
		</div>

		<table class="table">
			<thead>
			<th width="50"><input type="checkbox" onclick="selectAll(this.checked)" /></th>
			<th>ID</th>
			<th>文集</th>
			<th>成员</th>
			<th>切换角色</th>
			<th>升级角色</th>
			<th>申请时间</th>
			<th>状态</th>
			<th>操作</th>
			</thead>
			<tbody>
			{foreach $list as $vo}
			<tr>
				<td><input type="checkbox" name="ids" value="{$vo.id}" /> </td>
				<td>{$vo.id}</td>
				<td>{$vo.book_id|get_book_name}</td>
				<td><a href="{:url('user/info',['id'=>$vo['user_id']])}">{$vo.user_id|get_nickname}</a></td>
				<td><a href="javascript:ajaxConfirm('{:url('member_change',['id'=>$vo['id']])}','切换角色',2);" class="btn btn-xs btn-info">{$vo.role_level|get_role}</a></td>
				<td>
					{if $vo['is_upgrade']==1:}
					<a href="javascript:ajaxConfirm('{:url('member_upgrade',['id'=>$vo['id']])}','升级角色',2);" class="btn btn-xs btn-success">待审核</a>
					{elseif $vo['is_upgrade']==2:}
					已升级
					{else:}
					无
					{/if}
				</td>
				<td>{$vo.create_time|get_time_ago}</td>
				<td>
					{if $vo['status']==1:}
					<a href="javascript:ajaxConfirm('{:url('member_state?params=status-0',['ids'=>$vo['id']])}','设为待审',2);" class="btn btn-xs btn-success">已通过</a>
					{else:}
					<a href="javascript:ajaxConfirm('{:url('member_state?params=status-1',['ids'=>$vo['id']])}','通过审核',2);" class="btn btn-xs btn-danger">待审核</a>
					{/if}
				</td>
				<td>
					<a href="javascript:ajaxConfirm('{:url('member_del',['ids'=>$vo['id']])}','删除',2);" class="btn btn-xs btn-danger">删除</a>
				</td>
			</tr>
			{/foreach}
			</tbody>
		</table>
		<div class="panel-footer">{empty $list->toArray():}暂无记录！{/empty}{$list->links()}</div>
	</div>

</div>

{include file='public/footer.html'}
</body>
</html>